'''
专项整治列表页面
'''
from Lib.base.keywords import KeyWords
from selenium.webdriver.common.by import By
from Lib.common.common_function import *
from Lib.base.page_object.login_page import LonginPage


class SpecialTask(KeyWords):
    '''
    专项整治类
    '''
    url = KeyWords.url + 'special-rectification/list'

    def special_task_create(self):
        '''
        专项整治筛选相关的功能测试
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\task\create_task.yaml')
        element_operation(self, data[0]['data'])

    def special_task_list(self):
        '''
        查看执法任务列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\task\task_list_by_status.yaml')
        element_operation(self, data[0]['data'])

    def special_task_deal(self):
        '''
        执法任务处理
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\task\task_deal.yaml')
        element_operation(self, data[0]['data'])

    def special_task_chargeback(self):
        '''
        执法任务退单
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\task\task_chargeback.yaml')
        element_operation(self, data[0]['data'])


if __name__ == '__main__':
    try:
        driver = choose_browser()
        L = LonginPage(driver)
        L.login('kobekq1', 'kobe8888')
        case = SpecialTask(driver)
        case.special_task_list()
        driver.quit()
    except Exception as s:
        print(s)
        driver.quit()
